Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

rename telemetry key names at the service level #769

Merged

Conversation

bmc-msft
Copy link
Contributor

@bmc-msft bmc-msft commented Apr 5, 2021

In #766, the telemetry keys were renamed to reduce confusion. However, this broke the telemetry keys within the agent due to a known issue using flattened json with aliases (See serde-rs/serde#1976).

This PR removes the aliases and fixes the agent level telemetry & logging.

src/api-service/__app__/onefuzzlib/proxy.py Show resolved Hide resolved
@@ -222,8 +222,8 @@ def save_proxy_config(self) -> None:
),
forwards=forwards,
region=self.region,
instrumentation_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"),
telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"),
instance_telemetry_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, whenever we grab these key from the environment, we need to remember and preserve the mapping instance <-> instrumentation, microsoft <-> telemetry.

I suggest renaming the env vars elsewhere, but in the meantime, maybe we should define wrappers to os.environ.get, e.g.:

def get_microsoft_telemetry_key() -> str:
    return os.environ.get("ONEFUZZ_TELEMETRY")

We could also just exports constants.

@bmc-msft bmc-msft mentioned this pull request Apr 5, 2021
@bmc-msft bmc-msft merged commit e21eafd into microsoft:main Apr 5, 2021
@bmc-msft bmc-msft deleted the rename-service-level-telemetry-keys branch April 5, 2021 19:23
@ghost ghost locked as resolved and limited conversation to collaborators May 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants